package com.serve.oa.config;




import com.serve.oa.tool.Snowflake;
import org.flowable.common.engine.impl.cfg.IdGenerator;
import org.flowable.spring.SpringProcessEngineConfiguration;
import org.flowable.spring.boot.EngineConfigurationConfigurer;
import org.springframework.context.annotation.Configuration;

import java.time.Duration;


@Configuration
public class FlowableConfiguration implements EngineConfigurationConfigurer<SpringProcessEngineConfiguration>
{
    @Override
    public void configure(SpringProcessEngineConfiguration springProcessEngineConfiguration) {
        springProcessEngineConfiguration.setIdGenerator(new IdGenerator() {
            @Override
            public String getNextId() {
                try {
                    return Snowflake.getSnowflakeId(); //id生成方法
                }catch (Exception e) {
                }
                return null;
            }
        });
    }
}